<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>01 axios</title>
    <script src="./js/vue.js"></script>
    <script src="./js/axios.min.js"></script>
    <style>
        .table{
            width: 800px;
            margin: 50px auto;
        }
        .table .tr{
            width: 800px;
        }
        .table .tr .item{
            width: 200px;
            height: 50px;
            line-height: 40px;
            text-align: center;
            background-color: darkblue;
            color: darkorange;
            float: left;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="table">
            <div class="tr">
                <div class="item">ID</div>
                <div class="item">姓名</div>
                <div class="item">年龄</div>
                <div class="item">操作</div>
            </div>
            <div class="tr" v-for="item in list">
                <div class="item">{{item.id}}</div>
                <div class="item">{{item.username}}</div>
                <div class="item">{{item.userphone}}</div>
                <div class="item">删除</div>
            </div>
        </div>
    </div>
</body>
<script>
    new Vue({
        el:"#app",
        data:{
            list:[],

        },
        created(){
            axios({
                method:"get",
                url:"http://localhost:2345/userinfo"
            }).then(res => {this.list = res.data})

            console.log(this.list)

        },
        methods:{

        }
    })
</script>
</html>